import request from '@/utils/request'

// 查询考勤记录列表
export function listHumanClockCount(query) {
  return request({
    url: '/oa/humanClockCount/list',
    method: 'get',
    params: query
  })
}

//
export function queryPerDaySum(query) {
  return request({
    url: '/oa/humanClockCount/queryPerDaySum',
    method: 'get',
    params: query
  })
}

//月报汇总概况统计
export function selectSumInfo(query) {
  return request({
    url: '/oa/humanClockCount/selectSumInfo',
    method: 'get',
    params: query
  })
}

export function selectLastByUserId(query) {
  return request({
    url: '/oa/humanClockCount/selectLastByUserId',
    method: 'get',
    params: query
  })
}

export function getSumDetail(query) {
  return request({
    url: '/oa/humanClockCount/getSumDetail',
    method: 'get',
    params: query
  })
}

/**
 * 通过月份以及用户id获取用户当月打卡条数
 * * @param query
 * @returns {AxiosPromise}
 */
export function getUserClockCountByMonth(query) {
  return request({
    url: '/oa/humanClockCount/getUserClockCountByMonth',
    method: 'get',
    params: query
  })
}


// 查询考勤记录详细
export function getHumanClockCount(id) {
  return request({
    url: '/oa/humanClockCount/' + id,
    method: 'get'
  })
}

// 新增考勤记录
export function addHumanClockCount(data) {
  return request({
    url: '/oa/humanClockCount',
    method: 'post',
    data: data
  })
}

// 修改考勤记录
export function updateHumanClockCount(data) {
  return request({
    url: '/oa/humanClockCount',
    method: 'put',
    data: data
  })
}

// 删除考勤记录
export function delHumanClockCount(id) {
  return request({
    url: '/oa/humanClockCount/' + id,
    method: 'delete'
  })
}
